package com.common.manager;

import java.util.List;

import org.springframework.stereotype.Component;

import com.framework.model.IData;
import com.framework.model.impl.DataMap;
import com.common.model.SystemInfoModel;


@Component
public class SystemInfoManager  extends BaseManager{
	
	@Override
	public void setSqlMapNameSpace() {
		this.sqlMapNameSpace = "com.common.security.model.SystemInfo";
	}
	
	
	/**
	 * 功能：判断系统中是否已经绑定角色信息
	 * @param conditionObj
	 * @return
	 */
	public boolean checkSystemRoleInfo(IData dataMap){
		boolean isFlag = true;
		SystemInfoModel systemInfoModel = (SystemInfoModel)super.getObjectInfo(dataMap);
		if(systemInfoModel!=null){
			 dataMap.put("sysCode",systemInfoModel.getSysCode());
			List sysRoleList = super.getObjectList("com.common.security.model.RoleInfo","selectSysRoleList",dataMap);
			if(sysRoleList!=null && sysRoleList.size()>0){
				isFlag = true;
			}else{
				isFlag = false;
			}
		}else{
			isFlag = false;
		}
		return isFlag;
	}
	
}
